home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / gpplib22.zoo / libtests / expected.out next >
Encoding:
Text File  |  1993-11-30  |  22.2 KB  |  658 lines

  1. tobstack
  2. enter anything at all, end with an EOF(^D)
  3.  
  4. unique words:
  5. deleted
  6. redundant
  7. with
  8. this
  9. in
  10. words
  11. the
  12. list
  13. simply
  14. should
  15. program
  16. The
  17. Obstacks
  18. for
  19. file
  20. test
  21. simple
  22. a
  23. is
  24. This
  25.  
  26.  
  27. Obstack vars:
  28. alignment_mask = 3
  29. chunk_size = 4080
  30. size = 0
  31. room = 4054
  32.  
  33. end of test
  34. tstring
  35. an empty String:
  36. A string initialized to Hello:Hello
  37. A string initialized to previous string:Hello
  38. A string initialized to previous string.at(1, 2):el
  39. A string initialized to @:@
  40. A string initialized to dec(20):20
  41. n = 20 atoi(n) = 20 atof(n) = 20
  42. z = x + y = Helloworld
  43. x += y; x = Helloworld
  44. y.prepend(x); y = Helloworld
  45. cat(x, y, x, x); x = HelloworldHello
  46. cat(y, x, x, x); x = worldHelloHello
  47. z = x + s +  + y.at(w) + y.after(w) + . = Hello, world.
  48. ch = x[0] = H
  49. z = x.at(2, 3) = llo
  50. x.at(2, 2) = r; x = Hero
  51. x.at(0, 1) = j; x = jello
  52. x.at(He) = je; x = jello
  53. x.at(l, -1) = i; x = Helio
  54. z = x.at(r) = ello
  55. z = x.before(o) = Hell
  56. x.before(ll) = Bri; x = Brillo
  57. z = x.before(2) = He
  58. z = x.after(Hel) = lo
  59. x.after(Hel) = p; x = Help
  60. z = x.after(3) = o
  61. z =   a bc; z = z.after(RXwhite); z =a bc
  62. x.gsub(l, ll); x = Hellllo
  63. x.gsub(r, ...); x = Hello should have been replaced by this string
  64. x.gsub(RXwhite, #); x = Hello#should#have#been#replaced#by#this#string
  65. z = x+y; z.del(loworl); z = Held
  66. reverse(x) = olleH
  67. x.reverse() = olleH
  68. upcase(x) = HELLO
  69. downcase(x) = hello
  70. capitalize(x) = Hello
  71. z = replicate(*, 10) = **********
  72. z = This string    has
  73. five words
  74. from split(z, RXwhite, w, 10), n words = 5:
  75. This
  76. string
  77. has
  78. five
  79. words
  80. z = join(w, nw, /); z =This/string/has/five/words
  81. enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
  82.  
  83. End of test
  84. tinteger
  85. one = 1
  86. one + 1 = 2
  87. two = 2
  88. twofiftysix = 256
  89. fact30 = factorial(30) = 265252859812191058636308480000000
  90. fact28 = factorial(28) = 304888344611713860501504000000
  91. fact30 + fact28 = 265557748156802772496809984000000
  92. fact30 - fact28 = 264947971467579344775806976000000
  93. fact30 * fact28 = 80872505331661933764010628483512781121876047953920000000000000
  94. fact30 / fact28 = 870
  95. fact30 % fact28 = 0
  96. -fact30 = -265252859812191058636308480000000
  97. lg(fact30) = 107
  98. gcd(fact30, fact28) = 304888344611713860501504000000
  99. sqrt(fact30) = 16286585271694955
  100. negfact31 = -8222838654177922817725562880000000
  101. fact30 + negfact31 = -7957585794365731759089254400000000
  102. fact30 - negfact31 = 8488091513990113876361871360000000
  103. fact30 * negfact31 = -2181131468794922353615366650200339706856997013317222400000000000000
  104. fact30 / negfact31 = 0
  105. fact30 % negfact31 = 265252859812191058636308480000000
  106. gcd(fact30, negfact31) = 265252859812191058636308480000000
  107. fib50 = fibonacci(50) = 12586269025
  108. fib48 = fibonacci(48) = 4807526976
  109. fib48 + fib50 = 17393796001
  110. fib48 - fib50 = -7778742049
  111. fib48 * fib50 = 60508827864880718400
  112. fib48 / fib50 = 0
  113. fib48 % fib50 = 4807526976
  114. gcd(fib50, fib48) = 1
  115. sqrt(fib50) = 112188
  116. pow64 = Ipow(2, 64) = 18446744073709551616
  117. lg(pow64) = 64
  118. s64 = 1 << 64 = 18446744073709551616
  119. s32 = s64 >> 32 = 4294967296
  120. comps64 = ~s64 = 18446744073709551615
  121. comps64 & s32 = 4294967296
  122. comps64 | s32 = 18446744073709551615
  123. comps64 ^ s32 = 18446744069414584319
  124.  
  125. enter an Integer: number = 1234abdecf99fed123
  126. enter another Integer: number = 0
  127. enter another Integer: number = -12345678901234567890
  128. 2^32 = 4294967296
  129. 2^32 % (2^32-1) = 1
  130. 2^32 % (2^32-1) = 1
  131.  
  132. End of test
  133. trationa
  134. one = 1
  135. two = 2
  136. third = 1/3
  137. half = 1/2
  138. third + half = 5/6
  139. third - half = -1/6
  140. third * half = 1/6
  141. third / half = 2/3
  142. onePointTwo = 5404319552844595/4503599627370496
  143. double(onePointTwo) = 1.2
  144. a = 1
  145. a += half = 3/2
  146. a -= half = 1
  147. a *= half = 1/2
  148. a /= half = 1
  149. approxpi = 355/113
  150. double(approxpi) = 3.14159
  151. rpi = Rational(PI) = 884279719003555/281474976710656
  152. double(rpi) = 3.14159
  153. approxpi + rpi = 199847224979684595/31806672368304128
  154. approxpi - rpi = 8484881165/31806672368304128
  155. approxpi * rpi = 313919300246262025/31806672368304128
  156. approxpi / rpi = 19984723346456576/19984721649480343
  157. -approxpi = -355/113
  158. abs(negapproxpi) = 355/113
  159.  
  160. enter a Rational in form a/b or a: number = 61727839/49382716
  161. approximating e as pow(1+1/n),n) for n =10
  162. double(approxe) = 2.59374
  163. log(approxe) = 0.953102
  164. approxe = 25937424601/10000000000
  165. approximating e as pow(1+1/n),n) for n =100
  166. double(approxe) = 2.70481
  167. log(approxe) = 0.995033
  168. approxe = 270481382942152609326719471080753083367793838278100277689020104911710151430673927943945601434674459097335651375483564268312519281766832427980496322329650055217977882315938008175933291885667484249510001/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  169. approximating e as pow(1+1/n),n) for n =1000
  170. double(approxe) = 2.71692
  171. log(approxe) = 0.9995
  172. approxe = 2716923932235892457383088121947577188964315018836572803722354774868894945523768158997885697298661429053421034015406256924859461187617653889457753593083386399572063538500432650176144488046171044844121805479607648086607018742077798375087855857012278053105042704758822511824867218226931719410407150364389665913091822576819072281835735365786202176167228686198158460724641052407506305826211156964723064441295969498221919251479211700941935114755531972677360157561485144237786816579422141378066423317811515462669946309306263409027388915931082226854264858661420878279983534424128672461206356847463821364630504359665171573635397346037274752410368174877433941234543153511100471651472869116068528478976916600585383497180172395573924789047989563714318957536493108041591460911612078698461739084741934442448701416575483263891529095158013233115648534154086009312190489168546024398834243847135102411661996020129557921444666343641039137906807591342742464200991933722791531063202677650581946360422027765645970182463780273161113009717582155489902677095053354207944772439271656447869921825959042801322775729022491402012084605367784456090892987682547811360481731795980637847551788259384243997341190753089343387201753821360405430310320564488741142120089460368986590136324737459372963666586532443570474179352656517635333744783401695951969936296323256525034685525470426185224036844803487442831639483152362831735350269624668701702424450940840884555271325190876102665277858154695092765613639718577127438538649414492678358762110235621776218781360881010654696273264706319088453035858355052988808507775439561385232652305316287705653436727647681405618323757201022946801118770148072424021385261829594248369890171583993147934044232792517118743393217276416179842097554494269012251329134783596037733973478306188255291484352384699871420472711423079586319041837563678498472779422282261024744394844558738378027105699691260086532632930941478779680554645850778168703661423819000515895232903243738763481571999080702098369316199601942246247887808385073821861517636839926907458184604648942036355256683219218129910422822177336785268627274482037476294341444562207197209503659518266210432791078248321015453218019586608696207295299183111963158564162419152742807437346241667671688466998244424726765837682151606230638111654756595917019206453978024157097042546937345673337179165242325399648121877178987723999503839197328183925340949191821443698275476295245249466361817367207248089144718808572152781037112209285944844021186534832159964297181970584453756163204297111185823467744743465840230098261424789313315093951766314459027947176701489215746884363426961577348384651887153140609616362927338107686794499974902581579897076172716541504294334300741444106749994715713419630688719451362658288812132056854807330827050505064714442618243101018812153563795539024370219967801515099970721926240625418512417940854760415566229746248973756297569452302821563467574313259066016089521122779204844875998864114930516063910324359331903843040069467324167490917499501000001/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  173.  
  174. End of test
  175. tcomplex
  176. Complex one = (1, 0)
  177. i = (0, 1)
  178. neg_one = (-1, 0)
  179. sqrt(neg_one) = (0, 1)
  180. a = (2, 3)
  181. b = (4, 5)
  182. a + one = (3, 3)
  183. a - one = (1, 3)
  184. a * one = (2, 3)
  185. a / one = (2, 3)
  186. a + b = (6, 8)
  187. a - b = (-2, -2)
  188. a * b = (-7, 22)
  189. a / b = (0.560976, 0.0487805)
  190. c = a; c += b = (6, 8)
  191. c = a; c -= b = (-2, -2)
  192. c = a; c *= b = (-7, 22)
  193. c = a; c /= b = (0.560976, 0.0487805)
  194. -a = (-2, -3)
  195. real(a) = 2
  196. imag(a) = 3
  197. conj(a) = (2, -3)
  198. norm(a) = 13
  199. abs(a) = 3.60555
  200. arg(a) = 0.982794
  201. cos(a) = (-4.18963, -9.10923)
  202. sin(a) = (9.1545, -4.16891)
  203. cosh(a) = (-3.72455, 0.511823)
  204. sinh(a) = (-3.59056, 0.530921)
  205. log(a) = (1.28247, 0.982794)
  206. exp(a) = (-7.31511, 1.04274)
  207. sqrt(a) = (1.67415, 0.895977)
  208. pow(a, 2) = (-5, 12)
  209. pow(a, b) = (-0.753046, -0.986429)
  210. enter a Complex number in form (a, b) or (a) or a: number = (1.2, -34)
  211.  
  212. End of test
  213. tbitset
  214. BitSet tests:
  215. a = 0*
  216. b = 000000000010*
  217. c = 1010101010101010101010101010101010101010*
  218. c[0] =1
  219. c[1] =0
  220. c[2] =1
  221. c[3] =0
  222. c[4] =1
  223. d = 00110011001100110011001100110011001100110*
  224. e = 1111000011110000111100001111000011110*
  225. u = ~a = 1*
  226. g = ~e = 0000111100001111000011110000111100001*
  227. ~c = 0101010101010101010101010101010101010101*
  228. c & d = 0010001000100010001000100010001000100010*
  229. c | d = 10111011101110111011101110111011101110110*
  230. c - d = 10001000100010001000100010001000100010*
  231. c ^ d = 10011001100110011001100110011001100110010*
  232. f = b = 100000000010*
  233. f &= c = 100000000010*
  234. f |= d = 10110011001100110011001100110011001100110*
  235. f -= e = 00000011000000110000001100000011000000110*
  236. f ^= u = 11111100111111001111110011111100111111001*
  237. h = d
  238. :00110011001100110011001100110011001100110*
  239. h.set(0):
  240. 10110011001100110011001100110011001100110*
  241. h.set(65):
  242. 1011001100110011001100110011001100110011000000000000000000000000010*
  243. h.clear(2):
  244. 1001001100110011001100110011001100110011000000000000000000000000010*
  245. h.invert(11,20):
  246. 1001001100101100110010110011001100110011000000000000000000000000010*
  247. h.set(21,30):
  248. 1001001100101100110011111111111100110011000000000000000000000000010*
  249. h.clear(31, 40):
  250. 1001001100101100110011111111111000000000000000000000000000000000010*
  251. h.test(0,5) = 1
  252. h.test(31,40) = 0
  253. set bits in e:
  254. 0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 32 33 34 35 
  255. clear bits in g (reverse order):
  256. 35 34 33 32 27 26 25 24 19 18 17 16 11 10 9 8 3 2 1 0 
  257.  
  258. End of test.
  259. tbitstri
  260. a      = 
  261. b      = 1000000001
  262. c      = 10101010101010101010
  263. d      = 00110011001100110011
  264. e      = 11110000111100001111
  265. f = b  = 1000000001
  266. g = ~e = 00001111000011110000
  267. h = d  = 00110011001100110011
  268. bits in e:
  269. 0 1 2 3 8 9 10 11 16 17 18 19 
  270. clear bits in g (reverse order):
  271. 19 18 17 16 11 10 9 8 3 2 1 0 
  272. ~c     = 01010101010101010101
  273. c & d  = 00100010001000100010
  274. c | d  = 10111011101110111011
  275. c - d  = 10001000100010001000
  276. c ^ d  = 10011001100110011001
  277. c + d  = 1010101010101010101000110011001100110011
  278. c <<2  = 0010101010101010101010
  279. c >>2  = 101010101010101010
  280. f &= c = 1000000000
  281. f |= d = 10110011001100110011
  282. f -= e = 10000000000000000000
  283. f ^= c = 00101010101010101010
  284. f += b = 001010101010101010101000000001
  285. f <<=5 = 00000001010101010101010101000000001
  286. f >>=10= 0101010101010101000000001
  287. l = 101010101010101010100011001100110011001110101010101010101010
  288. BitPattern pat = 0011XXXX0011XXXX0011
  289. pat.pattern    = 00110011001100110011
  290. pat.mask       = 11110000111100001111
  291. l.index(pat)   = 20
  292. l.index(pat,-1)= 20
  293. l.before(pat)  = 10101010101010101010
  294. l.at(pat)      = 00110011001100110011
  295. l.after(pat)   = 10101010101010101010
  296. b.set(0)       :1000000001
  297. b.set(65):
  298. 100000000100000000000000000000000000000000000000000000000000000001
  299. b.clear(2):
  300. 100000000100000000000000000000000000000000000000000000000000000001
  301. b.invert(11,20):
  302. 100000000100111111111000000000000000000000000000000000000000000001
  303. b.set(21,30):
  304. 100000000100111111111111111111100000000000000000000000000000000001
  305. b.clear(31, 40):
  306. 100000000100111111111111111111100000000000000000000000000000000001
  307. b.set(0)       :10110011001100110011
  308. b.set(65):
  309. 101100110011001100110000000000000000000000000000000000000000000001
  310. b.clear(2):
  311. 100100110011001100110000000000000000000000000000000000000000000001
  312. b.invert(11,20):
  313. 100100110010110011001000000000000000000000000000000000000000000001
  314. b.set(21,30):
  315. 100100110010110011001111111111100000000000000000000000000000000001
  316. b.clear(31, 40):
  317. 100100110010110011001111111111100000000000000000000000000000000001
  318. k = 0101
  319. c.before(k) = 1
  320. c.at(k)     = 0101
  321. c.after(k)  = 010101010101010
  322. c.after(k)=k :101010101
  323. c.before(k)=k:010101010101
  324. reverse(k)           = 1010
  325. k.left_trim(0)       : 101
  326. k.right_trim(1)      : 10
  327. k = 0110
  328. c.before(k) = 0
  329. c.at(k)     = 0110
  330. c.after(k)  = 011001100110011
  331. c.after(k)=k :001100110
  332. c.before(k)=k:011001100110
  333. reverse(k)           = 0110
  334. k.left_trim(0)       : 110
  335. k.right_trim(1)      : 110
  336.  
  337. End of test.
  338. trandom
  339. five random ACG integers:
  340. 1525072166 1954057046 3406008937 226879594 4107049426 
  341. five random MLCG integers:
  342. 1341853672 83475514 936613571 888739672 2097844081 
  343. Binomial r1( 100, 0.50, &gen1) ...
  344. five samples:
  345. 45 52 59 49 60 
  346. Statistics for 100 samples:
  347. samples: 100 min: 40 max: 64
  348. mean: 50.78 stdDev: 4.42577 var: 19.5875 confidence(95): 0.878369
  349. Erlang r2( 2.0, 0.5, &gen1) ...
  350. five samples:
  351. 1.79909 1.92989 2.50816 2.31409 1.48158 
  352. Statistics for 100 samples:
  353. samples: 100 min: 0.592645 max: 3.81874
  354. mean: 1.96664 stdDev: 0.696406 var: 0.484981 confidence(95): 0.138213
  355. Geometric r3(&gen1, 0.5)...
  356. five samples:
  357. 3 2 2 2 3 
  358. Statistics for 100 samples:
  359. samples: 100 min: 1 max: 7
  360. mean: 1.9 stdDev: 1.28315 var: 1.64646 confidence(95): 0.254662
  361. HyperGeometric r4( 10.0, 150.0, &gen1)...
  362. five samples:
  363. 15.0752 5.25802 7.82211 20.4995 7.08199 
  364. Statistics for 100 samples:
  365. samples: 100 min: 0.0446068 max: 131.508
  366. mean: 12.6763 stdDev: 16.7567 var: 280.786 confidence(95): 3.32564
  367. NegativeExpntl r5( 1.0, &gen1)...
  368. five samples:
  369. 1.90665 0.0921974 0.219318 1.79202 0.566202 
  370. Statistics for 100 samples:
  371. samples: 100 min: 0.00794624 max: 4.23124
  372. mean: 0.927343 stdDev: 0.8869 var: 0.786592 confidence(95): 0.17602
  373. Normal r6( 0.0, 1.0, &gen1)...
  374. five samples:
  375. -0.174892 0.148871 -0.479753 0.65432 -0.92688 
  376. Statistics for 100 samples:
  377. samples: 100 min: -2.22325 max: 2.61771
  378. mean: 0.141292 stdDev: 0.972041 var: 0.944864 confidence(95): 0.192918
  379. LogNormal r7( 1.0, 1.0, &gen1)...
  380. five samples:
  381. 2.15572 0.985688 0.340019 0.959144 1.06052 
  382. Statistics for 100 samples:
  383. samples: 100 min: 0.0393323 max: 6.16358
  384. mean: 1.03547 stdDev: 0.963892 var: 0.929088 confidence(95): 0.191301
  385. Poisson r8( 2.0, &gen1)...
  386. five samples:
  387. 0 2 1 2 1 
  388. Statistics for 100 samples:
  389. samples: 100 min: 0 max: 5
  390. mean: 2 stdDev: 1.31041 var: 1.71717 confidence(95): 0.260073
  391. DiscreteUniform r9( 0.0, 1.0, &gen1)...
  392. five samples:
  393. 1 1 0 0 0 
  394. Statistics for 100 samples:
  395. samples: 100 min: 0 max: 1
  396. mean: 0.45 stdDev: 0.5 var: 0.25 confidence(95): 0.0992334
  397. Uniform r10( 0.0, 1.0, &gen1)...
  398. five samples:
  399. 0.557314 0.529968 0.997197 0.25163 0.947497 
  400. Statistics for 100 samples:
  401. samples: 100 min: 0.00205286 max: 0.997197
  402. mean: 0.518789 stdDev: 0.321429 var: 0.103317 confidence(95): 0.0637931
  403. Weibull r11( 0.5, 1.0, &gen1)...
  404. five samples:
  405. 10.4918 0.295112 0.184577 2.14799 0.10053 
  406. Statistics for 100 samples:
  407. samples: 100 min: 0.000236481 max: 15.4934
  408. mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
  409. SampleHistogram for 100 Normal samples
  410. < -4 : 0
  411. < -3.2 : 0
  412. < -2.4 : 0
  413. < -1.6 : 7
  414. < -0.8 : 15
  415. < -2.22045e-16 : 36
  416. < 0.8 : 15
  417. < 1.6 : 19
  418. < 2.4 : 7
  419. < 3.2 : 1
  420. < 4 : 0
  421. < max : 0
  422.  
  423. End of test
  424. tfix
  425. Fix: identities should be displayed
  426. [X] displays the precision of a given value
  427. [*] indicates that the full precision is not used for coding reasons
  428. 0 [16] =  0.00000 [16]
  429. .5 [16] =  0.50000 [16]
  430. -.5 [17] = -0.50000 [17]
  431. .1 [33] =  0.10000 [33]
  432. -.5 [17] = -0.50000 [17]
  433. .3 [16] =  0.29999 [16]
  434. .5 [16] =  0.50000 [16]
  435. .1 [16] =  0.09998 [16]
  436. .1 [33*] =  0.09998 [33]
  437. -.2 [17] = -0.20001 [17]
  438. -.5 [17] = -0.50000 [17]
  439. .1 [16] == .1 [33*] = 1
  440. .1 [16] == .1 [33] = 0
  441. .1 [33] != .5 [16] = 1
  442. .1 [33] > .5 [16] = 0
  443. .1 [33] <= -.2 [17] = 0
  444. 1073741824 = 1.07374e+09
  445. .5 = 0.5
  446. .5 [17] =  0.50000 [17]
  447. -.5 [17] = -0.50000 [17]
  448. .1 [33] + .5 [16] =  0.60000 [33]
  449. .1 [33] - .5 [16] = -0.40000 [33]
  450. .1 [33] * .5 [16] =  0.05000 [49]
  451. .1 [33] *  3 =  0.30000 [33]
  452. .1 [33] * -3 = -0.30000 [33]
  453. -.1 [33] *  3 = -0.30000 [33]
  454. -.1 [33] * -3 =  0.30000 [33]
  455. .5 [17] * -2 = -1.00000 [17]
  456. .1 [33] % 25 =  0.10000 [58]
  457. .1 [33] % -25 =  0.09375 [8]
  458. .1 [33] / .5 [16] =  0.20001 [33]
  459. .1 [33] << 1 =  0.20000 [33]
  460. -.1 [33] >> 2 =  0.47500 [33]
  461. abs(-.2) =  0.20001 [17]
  462. abs(.2) =  0.20001 [17]
  463. sgn(-.2) = -1
  464. sgn(.2) = 1
  465.  
  466. show .1 [33]
  467. len = 33
  468. siz = 3
  469. ref = 1
  470. man = ccccccc8000            
  471. val = 0.1
  472.  
  473. Fix: range errors warned
  474. 1.1 [16] =  0.00000 [16]
  475. .5 [16] / .1 [33] =  0.00000 [16]
  476. .5 [16] / 0. [16] =  0.00000 [16]
  477. .5 [17] * 32768 = -1.00000 [17]
  478.  
  479. Fix: overflows saturated
  480. .95 [16] + .1 [33] =  1.00000 [33]
  481. -.1 [33] - .95 [16] = -1.00000 [33]
  482. .5 [17] * 2 =  0.99998 [17]
  483.  
  484. Fix: overflows generate warnings
  485. .95 [16] + .1 [33] = -0.94999 [33]
  486. -.1 [33] - .95 [16] =  0.94999 [33]
  487. .5 [17] * 2 = -0.49994 [17]
  488. tfix16
  489. Fix16: identities should be displayed
  490. 0 = 0
  491. .5 = 0.5
  492. -.5 = -0.5
  493. .1 = 0.100006
  494. .5 = 0.5
  495. .5 = 0.5
  496. .25 = 0.25
  497. 8192 = 8192
  498. .25 = 0.25
  499. .25 = 0.25
  500. .25 = 0.25
  501. -.25 = -0.25
  502. .1 + .5 = 0.600006
  503. .1 - .5 = -0.399994
  504. .1 * .5 = 0.0500031
  505. .1 *  3 = 0.300018
  506. .1 * -3 = -0.300018
  507. .1 / .5 = 0.200012
  508. .1 << 1 = 0.200012
  509. -.5 >> 2 = -0.125
  510. .1 == .5 = 0
  511. .1 != .5 = 1
  512. .1 > .5 = 0
  513. .5 <= -.5 = 0
  514. Fix16: range errors ignored and overflows saturated
  515. 1.1 = 0.999969
  516. .7 + .5 = 0.999969
  517. -.5 - .7 = -1
  518. .5 / .1 = 0.999969
  519. Fix32: identities should be displayed
  520. 0 = 0
  521. .5 = 0.5
  522. -.5 = -0.5
  523. .1 = 0.1
  524. .5 = 0.5
  525. .5 = 0.5
  526. .25 = 0.25
  527. 536870912 = 536870912
  528. .25 = 0.25
  529. .25 = 0.25
  530. .25 = 0.25
  531. -.25 = -0.25
  532. .1 + .5 = 0.6
  533. .1 - .5 = -0.4
  534. .1 * .5 = 0.05
  535. .1 *  3 = 0.3
  536. .1 * -3 = -0.3
  537. .1 / .5 = 0.2
  538. .1 << 1 = 0.2
  539. -.5 >> 2 = -0.125
  540. .1 == .5 = 0
  541. .1 != .5 = 1
  542. .1 > .5 = 0
  543. .5 <= -.5 = 0
  544. Fix32: range errors reported and overflows reported
  545. 1.1 = 1
  546. .7 + .5 = -0.8
  547. -.5 - .7 = 0.8
  548. .5 / .1 = 1
  549. tfix24
  550. Fix24: identities should be displayed
  551. 0 = 0
  552. .5 = 0.5
  553. -.5 = -0.5
  554. .1 = 0.1
  555. .5 = 0.5
  556. .5 = 0.5
  557. .25 = 0.25
  558. 536870912 = 536870912
  559. .25 = 0.25
  560. .25 = 0.25
  561. .25 = 0.25
  562. -.25 = -0.25
  563. .1 + .5 = 0.6
  564. .1 - .5 = -0.4
  565. .1 * .5 = 0.05
  566. .1 *  3 = 0.3
  567. .1 * -3 = -0.3
  568. .1 / .5 = 0.2
  569. .1 << 1 = 0.2
  570. -.5 >> 2 = -0.125
  571. .1 == .5 = 0
  572. .1 != .5 = 1
  573. .1 > .5 = 0
  574. .5 <= -.5 = 0
  575. Fix24: range errors ignored and overflows saturated
  576. 1.1 = 1
  577. .7 + .5 = 1
  578. -.5 - .7 = -1
  579. .5 / .1 = 1
  580. Fix48: identities should be displayed
  581. 0 = 0
  582. .5 = 0.5
  583. -.5 = -0.5
  584. .1 = 0.1
  585. .5 = 0.5
  586. .5 = 0.5
  587. .25 = 0.25
  588. 536870912 = 536870912
  589. 0 = 0
  590. .25 = 0.25
  591. .25 = 0.25
  592. .25 = 0.25
  593. -.25 = -0.25
  594. .1 + .5 = 0.6
  595. .1 - .5 = -0.4
  596. .1 *  3 = 0.3
  597. .1 * -3 = -0.3
  598. .1 << 1 = 0.2
  599. -.5 >> 2 = -0.125
  600. .1 == .5 = 0
  601. .1 != .5 = 1
  602. .1 > .5 = 0
  603. .5 <= -.5 = 0
  604. Fix48: range errors reported and overflows reported
  605. 1.1 = 1
  606. .7 + .5 = -0.8
  607. -.5 - .7 = 0.8
  608. tillist
  609. prepending...
  610. a: 9 8 7 6 5 4 3 2 1 0 
  611. appending...
  612. a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 
  613. b = a: 
  614. 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 
  615. remove_front of first 10 elements:
  616. b: 0 1 2 3 4 5 6 7 8 9 
  617. inserting 100 after sixth element...
  618. b: 0 1 2 3 4 5 100 6 7 8 9 
  619. after a.join(b)
  620. 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9 
  621. b: 
  622.  
  623. b: 
  624. 999 
  625. bb: 
  626. 999 
  627. prepending...
  628. a: 
  629. 9 8 7 6 5 4 3 2 1 0 
  630. appending...
  631. a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 
  632. b = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 
  633. remove_front of first 10 elements:
  634. b: 0 1 2 3 4 5 6 7 8 9 
  635. inserting 100 after sixth element...
  636. b: 0 1 2 3 4 5 100 6 7 8 9 
  637. after aa = a; aa.join(b)
  638. 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 100 6 7 8 9 
  639. b: 
  640.  
  641. b: 
  642. 999 
  643. bb: 
  644. 999 
  645. z = a: 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 
  646. remove_rear of last 10 elements:
  647. z: 9 8 7 6 5 4 3 2 1 0 
  648. inserting 100 before alternate elements...
  649. z: 100 9 100 8 100 7 100 6 100 5 100 4 100 3 100 2 100 1 100 0 
  650. inserting 200 after sixth element...
  651. z: 100 9 100 8 100 7 200 100 6 100 5 100 4 100 3 100 2 100 1 100 0 
  652. deleting alternate elements of z...100 100 100 200 6 5 4 3 2 1 0 
  653. z: 9 8 7 100 100 100 100 100 100 100 
  654. z in reverse order:
  655. 100 100 100 100 100 100 100 7 8 9 
  656.  
  657. End of test
  658.